﻿/******************************************************************************
* File description: animationManager_Practice.h
* Function: 打靶动画Manager，维护state和controller和外部接口
* Current Version: 1.0.0
* Author: JNN
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/

#ifndef ANIMATIONMANAGER_PRACTICE_H
#define ANIMATIONMANAGER_PRACTICE_H

#include <QObject>

#include <QThread>


#include "CommonHelper.h"
#include "StaticProperties.h"
#include "animationController_Practice.h"
#include "animationState_Practice.h"
#include "StaticProperties.h"

// 打靶
class AnimationManager_Practice : public QObject
{
    Q_OBJECT

private:
    AnimationManager_Practice();
    ~AnimationManager_Practice();

public:

    static AnimationManager_Practice& I();

    Q_INVOKABLE QVariantMap requestInfo();

    Q_INVOKABLE void    reset();

    Q_INVOKABLE void    oneButtonInTarget();    // 一键进靶
    Q_INVOKABLE void    oneButtonOutTarget();   // 一键退靶

    Q_INVOKABLE void    feedPortUp();       // 进料口上移
    Q_INVOKABLE void    feedPortDown();     // 进料口下移
    Q_INVOKABLE void    barMoveLeft();      // 靶材向左边黄球那边动
    Q_INVOKABLE void    barMoveRight();     // 靶材往右边进料口那边移
    Q_INVOKABLE void    turnWheelLeft();    // 转盘向左转
    Q_INVOKABLE void    turnWheelDown();    // 转盘向下转

    Q_INVOKABLE void    openPump1();        // 气泵开关
    Q_INVOKABLE void    closePump1();
    Q_INVOKABLE void    openPump2();        // 水泵开关
    Q_INVOKABLE void    closePump2();
    Q_INVOKABLE void    openBlowTarget();   // 下面那根管子吹气
    Q_INVOKABLE void    closeBlowTarget();
    Q_INVOKABLE void    openBrake();        // 抱闸夹紧
    Q_INVOKABLE void    closeBrake();       // 关闭抱闸
    Q_INVOKABLE void    openPumpHe();       // 开关氦气气泵
    Q_INVOKABLE void    closePumpHe();
    Q_INVOKABLE void    openAbsorb();       // 吸取梭体
    Q_INVOKABLE void    closeAbsorb();

    Q_INVOKABLE QVariantMap  getCheckInfo(int pageIdx);     // 小黄条

    Q_INVOKABLE QStringList getTargetStatus();


public:

    AnimationController_Practice* _controller = nullptr;
    AnimationState_Practice*      _state = nullptr;

};

#endif // ANIMATIONMANAGER_PRACTICE_H
